import requests
from config import url, headers_web

class CourseProjectStatistics:

    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def projectNum(cls, url: str, params=None,headers=headers_web):
        '''
        @Summary:开授实验课程所涉及的实验项目数
        @Description:开授实验课程所涉及的实验项目数
        :param url:
        :param params:
        :return:
        '''
        url = url + "/courseApi/api/v1/courseProject/statistics"
        r = requests.get(url=url,headers=headers,params=params)
        return r

if __name__ == '__main__':

    from common.hashlib_utils import hash_md5

    valid_code = hash_md5("&signKey=123123")
    resp = CourseProjectStatistics.projectNum(url, params={
        "schoolYear": "2022-2023",
        "term": "2",
        "validCode": valid_code
    })
    print(resp.url, "\n", resp, resp.json())
    print(resp.request.headers, "\n", resp.request.method)
